package com.cloud.freeflow.api.web;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.cloud.freeflow.api.entity.ProcActAttr;
import com.cloud.freeflow.api.entity.ProcActProperty;
import com.cloud.freeflow.api.entity.ProcActType;
import com.cloud.freeflow.api.service.ProcDictService;
import com.cloud.freeflow.common.result.Quokka;

@RestController
@RequestMapping("freeflow/api/dict")
public class ProcDictController {

	@Autowired
	private ProcDictService procDictService;

	@GetMapping("/actattr")
	public Quokka loadActAttr() {
		List<ProcActType> types = procDictService.loadProcActType();
		List<ProcActProperty> propertys = procDictService.loadProcActProperty();
		List<ProcActAttr> attrs = procDictService.loadProcActAttr();
		Map<String, Object> data = new HashMap<String, Object>();
		data.put("types", types);
		data.put("propertys", propertys);
		data.put("attrs", attrs);
		return new Quokka(true, data);
	}
}
